import request from "@/utils/request";

// 查询客户电子会员卡充值优惠设置列表
export function listSetting(query) {
  return request({
    url: "/customer/cardsetting/list",
    // url: '/customer/cardsetting/listSetting',
    method: "get",
    params: query,
  });
}

// 查询客户电子会员卡充值优惠设置详细
export function getSetting(id) {
  return request({
    url: "/customer/cardsetting/settingInfo/" + id,
    method: "get",
  });
}

// 删除客户电子会员卡充值优惠设置
export function delSetting(id) {
  return request({
    url: "/customer/cardsetting/" + id,
    method: "delete",
  });
}

// 导出客户电子会员卡充值优惠设置
export function exportSetting(query) {
  return request({
    url: "/customer/cardsetting/export",
    method: "get",
    params: query,
  });
}

// 查询客户电子会员卡充值优惠设置详细
export function selectCustomerCardSetting(query) {
  return request({
    // url: '/customer/cardsetting/selectCustomerCardSetting' ,
    url: "/customer/cardsetting/listSetting",
    method: "get",
    params: query,
  });
}

// 修改客户电子会员卡充值优惠设置
export function updateSetting(data) {
  return request({
    url: "/customer/cardsetting/editSetting",
    method: "post",
    data: data,
  });
}

// 新增客户电子会员卡充值优惠设置
export function addSetting(data) {
  return request({
    url: "/customer/cardsetting/addSetting",
    method: "post",
    data: data,
  });
}

//----------------

// 新增等级
export function addActivityList(data) {
  return request({
    url: "/customer/detail",
    method: "post",
    data: data,
  });
}

// 更新等级
export function upActivityList(data) {
  return request({
    url: "/customer/detail",
    method: "put",
    data: data,
  });
}

// 查询电子卡规则列表
export function getCardActivityList(query) {
  return request({
    url: "/customer/detail/list",
    method: "get",
    params: query,
  });
}

// 删除等级
export function delActivityList(data) {
  return request({
    url: "/customer/detail/deleteDetail",
    method: "post",
    data: data,
  });
}

// 新电子卡充值活动
// 查询客户电子会员卡充值优惠设置明细列表
export function detailList(query) {
  return request({
    url: "/customer/detail/list",
    method: "get",
    params: query,
  });
}

// 逻辑删除活动信息
export function deleteDetails(ids) {
  return request({
    url: "/customer/detail/deleteDetails/" + ids,
    method: "delete",
  });
}

// 更新活动状态
export function updateStatus(status, ids) {
  return request({
    url: `/customer/detail/updateStatus/${status}/${ids}`,
    method: "get",
  });
}

// 新增客户电子会员卡充值优惠设置明细
export function customerDetail(data) {
  return request({
    url: "/customer/detail",
    method: "post",
    data: data,
  });
}

// 获取客户电子会员卡充值优惠设置明细详细信息
export function detailGetInfo(id) {
  return request({
    url: "/customer/detail/getInfo/" + id,
    method: "get",
  });
}

// POST /customer/detail/addConsumeActivity新增客户电子会员卡消费返额设置
export function addConsumeActivity(data) {
  return request({
    url: "/customer/detail/addConsumeActivity",
    method: "post",
    data: data,
  });
}
